<!-- allorders 页面内容 -->
<section class="allorders" ng-controller="allordersCtrl">
    <div class="container">
        <div class="row margin-reset">
            <div class="col col-md-8 col-sm-8 col-xs-12 screen">
                <empty data='orders'></empty>
                <ul class="list-group">
                    <li class="list-group-item yf-shadow" ng-repeat='order in orders track by $index'>
                        <order-label state='order.mount_order'></order-label>
                        <div class="row">
                            <div class="col col-md-8 col-sm-8 col-xs-8 detail" style="padding: 50px 0px 10px 8px;">
                                <div class="col time">订单号: {{ order.serial_number }}</div>
                                <div class="col" ng-if='!order.mount_order'>
                                    测量时间: {{ order.booking_date * 1000 | date:"yyyy-MM-dd HH:mm" }}
                                </div>
                                <div class="col" ng-if='order.mount_order'>
                                    安装时间: {{ order.install_date * 1000 | date:"yyyy-MM-dd HH:mm" }}
                                </div>
                                <div class="col name">姓名: <span class="name">{{ order.name }}</span></div>
                                <div class="col material">预估面积: {{order.square}}(㎡) | 品牌: {{order.company_name}}</div>
                                <div class="col address">
                                    <span class="glyphicon glyphicon-map-marker"></span>
                                    <span ng-bind='order.address'></span>
                                </div>
                            </div>
                            <div class="col col-md-4 col-sm-4 col-xs-4 order text-center">
                                <h4>预计安装收入</h4>
                                <strong>￥{{order.total}}</strong>
                                <p ng-if="order.distance">距离您{{order.distance}}</p>
                                <button class="btn btn-default yf-btn btn-get-order" ng-click="competeOrder(order.id, $index);">抢订单</button>
                            </div>
                        </div>
                    </li>
                </ul>
                <nav ng-show="orders && orders.length != 0 && page.total_count > limit">
                    <ul class="pager pager-sm yf-pager">
                        <li>
                            <a class="btn btn-default" ng-disabled="!((page.current_page - 1) >= 1)" ng-click="getOrders(page.current_page - 1);">上一页</a>
                        </li>
                        <li>
                            <a class="btn btn-default" ng-disabled="!page.next_page" ng-click="getOrders(page.next_page);">下一页</a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="col col-md-3 col-sm-3 col-xs-3 serverperson hidden-xs">
                <img ng-src="{{ user.headimg.url }}?imageView2/1/w/200/h/200/interlace/1">
                <h4>{{user.real_name}}</h4>
                <div>{{ user.raty | raty }}评分 {{ user.orders_count }}单</div>
                <br>
                <br>
                <button class="btn" ui-sref="mine.list({ ctrl: 'angular-flatpickr,orders'})">进入主页</button>
            </div>
        </div>
    </div>
</section>
